#override("title")
SpringWind - 场地列表
#end
#override("css")
<link href="#springUrl('/static/css/plugins/bootstrap-table/bootstrap-table.min.css')" rel="stylesheet">
<link href="#springUrl('/static/css/less/style.css')" rel="stylesheet">
<style type="text/css">
	.d1{
		padding-right: 50%;
	}
	.d2{
		padding-right: 20%;
	}
</style>
#end
#override("breadcrumb")
<li><a>评分系统</a></li><li class="active"><strong>场地列表</strong>
	<!--<strong>$!{province}</strong><strong>$!{city}</strong>-->
</li>
<div class="container">
	<ul class="nav nav-pills nav-justified step step-arrow">
		<li>
			<a href="#springUrl('/examine/source')/${siteId}/0">污染物</a>
		</li>
		<li>
			<a href="#springUrl('/examine/ground')/${siteId}/0">地下水</a>
		</li>
		<li>
			<a href="#springUrl('/examine/surfaceIndex')/${siteId}/0/0/0">地表水</a>
		</li>
		<li>
			<a href="#springUrl('/examine/soil')/${siteId}">土壤</a>
		</li>
		<li>
			<a href="#springUrl('/examine/air')/${siteId}">空气</a>
		</li>
	</ul>
</div>
#end
#override("content")
<div class="row ibox-content" style="margin:3%;padding: 5% 10%">
	<form id="myForm" class="form-horizontal" autocomplete="off" data-validator-option="{theme:'default'}">
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">污染物释放可能性因子值:</label>
		</div>
		<input name="source_id" value="${siteId}" style="display: none">
		<div class="form-group"><label class="col-sm-2 control-label">1.污染物释放可能性因子值:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="likelihood_of_exposure" class="form-control" id="likelihoodOfExposure"style="width: 50%">
					<option>0</option>
					<option>550</option>
				</select>
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class="col-sm-2 control-label">废物特征:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">2.毒性:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="toxicity" name="toxicity"  value="0" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">使用物质:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="substance"  >-->
				<select name="substance" id="substance" class="form-control"style="width: 50%">
					<!--<option>Aldrin</option>
					<option>Benzidine</option>-->
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">3.有害废物量:<a onclick="surface(this.name)" name="2-6">(2-6)</a></label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="haza_quantity" name="haza_quantity"  value="$!{soil.haza_quantity}" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">4.废物特征:<a onclick="surface(this.name)" name="2-7">(2-7)</a></label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="waste_characteristics"  value="$!{soil.waste_characteristics}" readonly id="waste_characteristics">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class="col-sm-2 control-label" >目标因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">5.居住个人目标因子值:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="resident_individual"  >-->
				<select name="resident_individual" class="form-control" id="resident_individual"style="width: 50%">
					<option>0</option>
					<option>45</option>
					<option>50</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label" >6.居住人口目标因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">6a.暴露于水平1浓度的人口数量：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" name="pop_concent1"  placeholder="请输入该目标因子值" data-rule="人口目标因子值1:required;pop_concent1" value="$!{soil.pop_concent1}" readonly>
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="6aErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="6aMsg" onclick="closeErr(this.id)"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">6b.暴露于水平2浓度的人口数量：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" name="pop_concent2"  placeholder="请输入该目标因子值" data-rule="人口目标因子值2:required;pop_concent2" value="$!{soil.pop_concent2}" readonly>
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="6bErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="6bMsg" onclick="closeErr(this.id)"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">6c.居住人口目标因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="resident_population"  value="#if ( $soil.resident_population ) $!{soil.resident_population}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">7.工人目标因子值:<a onclick="surface(this.id)" id="5-4">(5-4)</a></label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="worker"  >-->
				<select name="worker" class="form-control" id="worker"style="width: 50%">
					<option>0</option>
					<option>5</option>
					<option>10</option>
					<option>15</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">8.资源目标因子值:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="resource"  >-->
				<select name="resources" class="form-control" id="resource"style="width: 50%">
					<option>0</option>
					<option>5</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">9.陆地敏感环境目标因子值:<a onclick="surface(this.id)" id="5-5">(5-5)</a></label>
			<div class="col-sm-10 d1">
				<select  class="form-control" name="terrestrial_sens_envion" style="width: 50%"  id="terrestrial_sens_envion">
					<option>25</option>
					<option>50</option>
					<option>75</option>
					<option>100</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">10.目标因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="targets"  value="#if ( $soil.targets ) $!{soil.targets}  #else  0  #end" readonly id="targets">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class=" control-label" >居住人口威胁评分:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">11.附近的居民/人口的威胁:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="re_ne_population"  value="#if ( $soil.re_ne_population ) $!{soil.re_ne_population}  #else  0  #end" readonly id="re_ne_population">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class="col-sm-2 control-label" >污染物释放可能性因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">12.污染土壤区域吸引性/可达性因子值:<a onclick="surface(this.id)" id="5-6">(5-6)</a></label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="attract_access"  >-->
				<select name="attract_access" class="form-control" id="attract_access"style="width: 50%">
					<option>0</option>
					<option>5</option>
					<option>10</option>
					<option>25</option>
					<option>50</option>
					<option>75</option>
					<option>100</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">13.污染土壤面积因子值:<a onclick="surface(this.id)" id="5-7">(5-7)</a></label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="areas_of_contamination"  >-->
				<select name="areas_of_contamination" class="form-control" style="width: 50%" id="areas_of_contamination">
					<option>5</option>
					<option>20</option>
					<option>40</option>
					<option>60</option>
					<option>80</option>
					<option>100</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">14.污染物释放可能性因子值:<a onclick="surface(this.id)" id="5-8">(5-8)</a></label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="likelihood_of_exposure2"  value="0" readonly id="likelihood_of_exposure2">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class="col-sm-2 control-label" >废物特征:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">15.毒性:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="toxicity1"  value="0" readonly id="toxicity1">
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">使用物质:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="substance"  >-->
				<select name="substance1" id="substance1" class="form-control"style="width: 50%">
					<!--<option>Aldrin</option>
					<option>Benzidine</option>-->
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">16.有害废物量:&nbsp;&nbsp;<a onclick="surface(this.name)" name="2-6">(2-6)</a></label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="haza_quantity1"  value="$!{soil.haza_quantity1}" readonly id="haza_quantity1">
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">17.废物特征:<a onclick="surface(this.name)" name="2-7">(2-7)</a></label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="waste_characteristics1"  value="$!{soil.waste_characteristics1}" readonly id="waste_characteristics1">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class="col-sm-2 control-label" >目标因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">18.附近个人目标因子值:<a onclick="surface(this.name)" name="5-9">(5-9)</a></label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="nearby_individual"  >-->
				<select name="nearby_individual" class="form-control" id="nearby_individual"style="width: 50%">
					<option>0</option>
					<option>1</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">19.暴露于潜在污染的人口数量:&nbsp;&nbsp;&nbsp;<a onclick="surface(this.name)" name="5-10">查表(5-10)得标准化人口数量</a></label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="pop_with"  value="$!{soil.pop_with}" id="pop_with" placeholder="请输入该目标因子值" data-rule="潜在人口目标因子值:required;pop_with" readonly>
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="19ErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="19Msg" onclick="closeErr(this.id)"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">20.目标因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="targets1"  value="#if ( $soil.targets1 ) $!{soil.targets1}  #else  0  #end" readonly id="targets1">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class=" control-label"  >附近人口威胁评分:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">21.附近人口的威胁:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="nearby_pop"  value="#if ( $soil.nearby_pop ) $!{soil.nearby_pop}  #else  0  #end" readonly id="nearby_pop">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class=" control-label" >土壤暴露途径评分:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">22.土壤暴露途径得分:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="soil_exp_score"  value="#if ( $soil.soil_exp_score ) $!{soil.soil_exp_score}  #else  0  #end" readonly id="soil_exp_score">
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label" >未经扫描得分:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="uncappedScore"  value="#if ( $soil.soil_exp_score ) $!{soil.soil_exp_score}  #else  0  #end" readonly id="uncapped_score">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group">
			<div class="text-center">
				<a class="btn btn-primary btn-next" href="#springUrl('/examine/surfaceIndex/')${siteId}/0/0/1" >  <  </a>
				<!-- <button class="btn btn-primary" type="submit">保 存</button>-->
				<a class="btn btn-primary btn-next" href="#springUrl('/examine/air/')${siteId}" >  >  </a>
			</div>
		</div>
	</form>
</div>
#end
#override("js")
<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table.min.js')"></script>
<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js')"></script>
<script src="#springUrl('/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js')"></script>
<!--<script src="#springUrl('/static/js/base_list.js')"></script>-->
<script src="#springUrl('/static/js/common.js')"></script>
<!--<script src="#springUrl('/static/js/jquery-2.1.1.js')"></script>-->
<script src="#springUrl('/static/plugins/layer-v2.2/layer/layer.js')"></script>
<script src="#springUrl('/static/js/lib/less.js')"></script>
<script src="#springUrl('/static/js/lib/jquery.min.js')"></script>
<script src="#springUrl('/static/js/lib/lib.js')"></script>
<!--<script src="#springUrl('/static/plugins/nice-validator-0.8.1/jquery.validator.js?local=zh-CN')"></script>-->
<script src="#springUrl('/static/plugins/nice-validator-0.8.1/jquery.validator.js?local=zh-CN')"></script>

<script type="text/javascript">
    //var soil = JSON.parse('${soil}');
    var siteId = '${siteId}';
    var dList = JSON.parse('${dangerouSelect}');
    var observable = '${observable}';
/*
    $("#myForm").validator({
        valid: function(form){
            var me = this;
            // 提交表单之前，hold住表单，防止重复提交
            me.holdSubmit();
            $.ajax({
                url: "#springUrl('/soil/caculateScore')",
                data: $(form).serialize(),
                type: "POST",
                success: function(data){
                    parent.layer.alert("保存成功",function(){
                        parent.layer.closeAll();
                        //  window.parent.location.reload();
                    });
                    // alert(data);
                    /!*var d = JSON.parse(data);
                    if(d.success && d.data){
                        window.parent.location.reload();
                        //当你在iframe页面关闭自身时
                        //var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        //parent.layer.close(index); //再执行关闭
                    } else {
                        //失败，提交表单成功后，释放hold，如果不释放hold，就变成了只能提交一次的表单
                        me.holdSubmit(false);
                    }*!/
                }
            });
        }
    });
*/
    var pop1 = $('input[name=pop_concent1]');
    var pop2 = $('input[name=pop_concent2]');
    var pop = $('input[name=resident_population]');
    var residentIndividual = $('#resident_individual');
    var worker = $('#worker');
    var resource = $('#resource');
    var terrestrialSensEnvion = $('#terrestrial_sens_envion');
    var targets = $('#targets');
    var reNePopulation = $('#re_ne_population');
    var likelihoodOfExposure = $('#likelihoodOfExposure');
    var wasteCharacteristics = $('#waste_characteristics');
    var attractAccess = $('#attract_access');
    var areasOfContamination = $('#areas_of_contamination');
    var likelihoodOfExposure2 = $('#likelihood_of_exposure2');
    var toxicity2 = $('#toxicity1');
    var haza_quantity = $('#haza_quantity');
    var hazaQuantity1 = $('#haza_quantity1');
    var wasteCharacteristics1 = $('#waste_characteristics1');
    var nearbyIndividual = $('#nearby_individual');
    var popWith = $('#pop_with');
    var targets2 = $('#targets1');
    var nearbyPop = $('#nearby_pop');
    var uncappedScore = $('#uncapped_score');
    var soilExpScore = $('#soil_exp_score');
    var substance = $('#substance');
    var substance1 = $('#substance1');
    var toxcity  = $('#toxicity');
    var toxcity1 = $('#toxicity1');

    $(function () {
        bsStep(4);
        selectIn(likelihoodOfExposure,'${soil.likelihood_of_exposure}');
        selectIn(residentIndividual,'${soil.resident_individual}');
        selectIn(worker,'${soil.worker}');
        selectIn(resource,'${soil.resources}');
        selectIn(terrestrialSensEnvion,'${soil.terrestrial_sens_envion}');
        selectIn(attractAccess,'${soil.attract_access}');
        selectIn(areasOfContamination,'${soil.areas_of_contamination}');
        selectIn(nearbyIndividual,'${soil.nearby_individual}');
        dangerousInfo('substance');
        dangerousInfo('substance1');
        substanceChange('substance','toxicity',haza_quantity);
        substanceChange('substance1','toxicity1',hazaQuantity1);
        likelihoodOfExposure2.val(caculateLikelihoodOfExposure2(attractAccess.val(),areasOfContamination.val()));
        //	alert(likelihoodOfExposure2.val());
        /* substance.change(function () {
             substanceChange('substance','toxicity');
         });
         substance1.change(function () {
             substanceChange('substance1','toxicity1');
         });*/
        /*$('input[name=wasteCharacteristics]').val($('input[name=toxicity]').val()*$('input[name=haza_quantity]').val());
        wasteCharacteristics1.val(hazaQuantity1.val()*toxicity2.val());*/
        caculateWasteCharacteristics(haza_quantity,toxcity,wasteCharacteristics);
        caculateWasteCharacteristics(hazaQuantity1,toxcity1,wasteCharacteristics1);
        hazaQuantity1.change(function () {
            wasteCharacteristics1.val(hazaQuantity1.val()*toxicity2.val());
            caculateNearbyPop();
        });
        toxicity2.change(function () {
            wasteCharacteristics1.val(hazaQuantity1.val()*toxicity2.val());
            caculateNearbyPop();
        });
        likelihoodOfExposure.change(function () {
            caculateResident();
        });
        $('input[name=toxicity]').change(function () {
            $('input[name=waste_characteristics]').val($('input[name=toxicity]').val()*$('input[name=haza_quantity]').val())
            caculateResident();
        });
        $('input[name=hazaQantity]').change(function () {
            $('input[name=waste_characteristics]').val($('input[name=toxicity]').val()*$('input[name=haza_quantity]').val());
            caculateResident();
        });
        //alert($('input[name=waste_characteristics]').val());
        $('input[name=pop_concent1]').change(function () {
            if(isNaN(parseInt(pop1.val()))||pop1.val()<0||!isDigit(pop1.val())){
                pop1.val(0);
                openErr('6a');
            }else {
                closeErr('6aMsg');
            }
            $('input[name=resident_population]').val(pop1.val()*10+pop2.val()*1);
            //   alert(  $('input[name=resident_population]').val());
            caculateTargets();
        });
        $('input[name=pop_concent2]').change(function () {
            if(isNaN(parseInt(pop2.val()))||pop2.val()<0||!isDigit(pop2.val())){
                pop2.val(0);
                openErr('6b');
            }else {
                closeErr('6bMsg');
            }
            $('input[name=resident_population]').val(pop1.val()*10+pop2.val()*1);
            caculateTargets();
        });
        residentIndividual.change(function () {
            caculateTargets();
        });
        worker.change(function () {
            caculateTargets();
        });
        resource.change(function () {
            caculateTargets();
        });
        terrestrialSensEnvion.change(function () {
//            if(isNaN(parseInt(terrestrialSensEnvion.val()))||terrestrialSensEnvion.val()<0||terrestrialSensEnvion.val()>500){
//                terrestrialSensEnvion.val(0);
//                openErr('9');
//            }else {
//                closeErr('9Msg');
//            }
            caculateTargets();
        });
        attractAccess.change(function () {
            likelihoodOfExposure2.val(caculateLikelihoodOfExposure2(attractAccess.val(),areasOfContamination.val()));
            caculateNearbyPop();
            //alert(likelihoodOfExposure2.val());
        });
        areasOfContamination.change(function () {
            likelihoodOfExposure2.val(caculateLikelihoodOfExposure2(attractAccess.val(),areasOfContamination.val()));
            caculateNearbyPop();
            //  alert(likelihoodOfExposure2.val());
        });
        nearbyIndividual.change(function () {
            caculateTargets1();
        });
        popWith.change(function () {
            if(isNaN(parseInt(popWith.val()))||popWith.val()<0||!isDigit(popWith.val())){
                popWith.val(0);
                openErr('19');
            }else {
                closeErr('19Msg');
            }
            caculateTargets1();
        });
    });
    function surface(id) {
        // alert("哈哈哈");
        //	alert(id);
        var title = "表"+id;
        var url = "#springUrl('/soil/surface"+id+".html')";
        layer.open({
            type: 2,
            title: title,
            shadeClose: true,
            shade: 0.8,
            area: ['750px', '430px'],
            fix: false,
            maxmin: false,
            content: url
        });
    }
    function  caculateTargets() {
        targets.val(pop.val()*1+residentIndividual.val()*1+worker.val()*1+resource.val()*1+terrestrialSensEnvion.val()*1);
        /*	alert(pop.val());
            alert(residentIndividual.val());
            alert(worker.val());
            alert(resource.val());
            alert(terrestrialSensEnvion.val());*/
        caculateResident();
    }
    function caculateResident() {
        reNePopulation.val(likelihoodOfExposure.val()*wasteCharacteristics.val()*targets.val());
        caculateScore();
    }
    function caculateLikelihoodOfExposure2(attractAccess,areasOfContamination) {
        if(attractAccess == 0){
            return 0;
        }else if(attractAccess==5){
            if (areasOfContamination<=60){
                return 5;
            }else if(areasOfContamination==80){
                return 25;
            }else if(areasOfContamination==100){
                return 125;
            }
        }else if(attractAccess==10){
            if(areasOfContamination<=40){
                return 5;
            }else if (areasOfContamination==60){
                return 25;
            }else if (areasOfContamination==80){
                return 50;
            }else if (areasOfContamination==100){
                return 125;
            }
        }else  if (attractAccess==25){
            if (areasOfContamination<=20){
                return 5;
            }else if (areasOfContamination==40) {
                return 25;
            }else if (areasOfContamination==60){
                return 50;
            }else if (areasOfContamination==80){
                return 125;
            }else if (areasOfContamination==100){
                return 250;
            }
        }else if (attractAccess==50){
            if(areasOfContamination==5){
                return 5;
            }else if (areasOfContamination<=20){
                return 25;
            }else if (areasOfContamination==40) {
                return 50;
            }else if (areasOfContamination==60){
                return 125;
            }else if (areasOfContamination==80){
                return 250;
            }else if (areasOfContamination==100){
                return 375;
            }
        }else if (attractAccess==75){
            if(areasOfContamination==5){
                return 25;
            }else if (areasOfContamination<=20){
                return 50;
            }else if (areasOfContamination==40) {
                return 125;
            }else if (areasOfContamination==60){
                return 250;
            }else if (areasOfContamination==80){
                return 375;
            }else if (areasOfContamination==100){
                return 500;
            }
        }else if (attractAccess==100){
            if(areasOfContamination==5){
                return 50;
            }else if (areasOfContamination<=20){
                return 125;
            }else if (areasOfContamination==40) {
                return 250;
            }else if (areasOfContamination==60){
                return 375;
            }else if (areasOfContamination==80){
                return 500;
            }else if (areasOfContamination==100){
                return 500;
            }
        }
        return 0;
    }
    function  caculateTargets1() {
        targets2.val(nearbyIndividual.val()*1+popWith.val()*0.1);
        caculateNearbyPop();
    }
    function caculateNearbyPop() {
        nearbyPop.val(likelihoodOfExposure2.val()*wasteCharacteristics1.val()*targets2.val());
        caculateScore();
    }
    function caculateScore() {
        uncappedScore.val(((reNePopulation.val()*1+nearbyPop.val()*1)/82500).toFixed(2));
        if(uncappedScore.val()>100){
            soilExpScore.val(100);
        }else {
            soilExpScore.val(uncappedScore.val());
        }
    }
    function openErr(id) {
        //alert(id);
        $('#'+id+'ErrMsg').css('display','block');
    }
    function closeErr(id) {
        $('#'+id).parent().css('display','none');
    }
    function isDigit(s)
    {
        var patrn=/^[0-9]{1,20}$/;
        if (!patrn.exec(s)) {
            //    alert("false");
            return false;
        }
        //  alert("true");
        return true;
    }
    function selectIn(key,value) {
        key.children("option").each(function(){
            var temp_value = $(this).val();
            if(temp_value == value){
                $(this).attr("selected","selected");
                key.attr('readonly','readonly');
            }
        });
    }

    function dangerousInfo(sub) {
        var selected = document.getElementById(sub);
        var op1 = "";
        for (i=0;i<dList.length;i++){
            op1+="<option value='"+i+"'>"+dList[i].chnname+"</option>";
        }
        selected.innerHTML = op1;
    }

    function substanceChange(sub,tox,haz) {
        var selected = document.getElementById(sub);
        var index = selected.selectedIndex;
        var dIndex = selected.options[index].value;//获取选中值的序号
        // var toxValue = document.getElementById(tox);
        $('#'+tox).val(dList[dIndex].tox);
        caculateHaza_quantity(dList[dIndex].tox,haz);
    }

    //直接按毒素的值进行计算
    function caculateHaza_quantity(tox,quantity) {
        if(parseFloat(tox)<=0){
            quantity.val(0);
        }else if(parseFloat(tox)>0&&parseFloat(tox)<=100){
            quantity.val(1);
        }else if(parseFloat(tox)>100&&parseFloat(tox)<=10000){
            quantity.val(100);
        }else if(parseFloat(tox)>10000&&parseFloat(tox)<=1000000){
            quantity.val(10000);
        }else if(parseFloat(tox)>1000000){
            quantity.val(1000000);
        }
    }

    function caculateWasteCharacteristics(quantity,tox,waste_characteristics) {
        var t = quantity.val()*tox.val();
        if(t ==0){
            waste_characteristics.val(0);
        }else if(t>0&&t<10){
            waste_characteristics.val(1);
        }else if(t>=10&&t<100){
            waste_characteristics.val(2);
        }else if(t>=100&&t<1000){
            waste_characteristics.val(3);
        }else if(t>=1000&&t<10000){
            waste_characteristics.val(6);
        }else if(t>=10000&&t<100000){
            waste_characteristics.val(10);
        }else if(t>=100000&&t<1000000){
            waste_characteristics.val(18);
        }else if(t>=1000000&&t<10000000){
            waste_characteristics.val(32);
        }else if(t>=10000000&&t<100000000){
            waste_characteristics.val(56);
        }else if(t>=100000000&&t<1000000000){
            waste_characteristics.val(100);
        }else if(t>=1000000000&&t<10000000000){
            waste_characteristics.val(180);
        }else if(t>=10000000000&&t<100000000000){
            waste_characteristics.val(320);
        }else if(t>=100000000000&&t<1000000000000){
            waste_characteristics.val(560);
        }else if(t>=1000000000000){
            waste_characteristics.val(1000);
        }
    }
</script>
#end
#extends("/common/framework.html")
